<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>材料质检</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="../../res/layuis/css/layui.css">
   <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
   <script type="text/javascript" src="../../res/layuis/layui.js" charset="utf-8"></script>
</head>
<body>
<div class="demoTable" style="margin-top: 10px;">
      <div class="layui-input-inline">
      <form class="layui-form" action="">
      
           <div class="layui-input-inline" style="margin-left: -5%;">
			<label class="layui-form-label">开始日期:</label>
			<input type="text" placeholder="yyyy-MM-dd" class="layui-input" id="startTime" style="width: 224px;height: 38px;">
			</div>
		
			<div class="layui-input-inline">
				<label class="layui-form-label"  >结束日期:</label>
				<input type="text" placeholder="yyyy-MM-dd"  class="layui-input" id="endTime" style="width: 224px;height: 38px;">
			</div>
   		 
   		 
        
      </form>
      </div>
       <div class="layui-input-inline">
      	<button class="layui-btn" id="search" data-type="reload" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
      </div>
<table class="layui-table"  lay-filter="demo" id="materialQualityTesting">
   
</table>
<script type="text/javascript">

layui.use('table',function(){
	  var table = layui.table;
	  var form = layui.form;
	  
	  table.render({
		    elem: '#materialQualityTesting'
		    	,page: true
		    ,url:'../../listenQualityTesting/findQualityTesting.action?qtType=1&companyId=1'
		    ,cols: [[
		    	   {field:'qtId'}
		    	  ,{field:'vocationalWorkId'}
			      ,{field:'stringQtTime',title: '提交质检时间',width:'15%'}
			      ,{field:'qtNumber',title: '总数量'}
			      ,{field:'qtNoNumber',title: '未通过数量'}
			      ,{field:'qtStatus',title: '质检状态',templet:'#qtStatuss',width:'10%'}
			      ,{field:'qtPass',title: '质检通过率', align:'center'}
			      ,{field:'oper',title: '操作人'}
			      ,{field:'companyName',title: '采购公司', align:'center'}
			      ,{field:'right', align:'center', toolbar: '#barDemo',title:'操作',width:'15%'}
		    ]],done: function (res, curr, count) {
		    	 $("[data-field='qtId']").css('display','none');
		    	 $("[data-field='vocationalWorkId']").css('display','none');
		    }
		  });
	  
	 
});
</script>
<script type="text/html" id="qtStatuss">
{{# if(d.qtStatus == 1) { }}
     <div>未质检</div>
 	 {{# } else if(d.qtStatus == 2){ }}
    <div>已质检未入库</div>
 {{# } else if(d.qtStatus == 3){ }}
    <div>已质检已入库</div>
{{# }}}
</script>
 
<script type="text/html" id="barDemo">
{{# if(d.qtStatus == 1) { }}
      <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="qualityTesting">立即质检</a>
 	 {{# } else if(d.qtStatus == 2){ }}
     <a class="layui-btn  layui-btn-xs" lay-event="qualityTestingDetail">查看质检详情</a>
	<a class="layui-btn layui-btn-warm  layui-btn-xs" lay-event="warehousing">入库</a>
     {{# } else if(d.qtStatus == 3){ }}
   	 <a class="layui-btn  layui-btn-xs" lay-event="qualityTestingDetail">查看质检详情</a>
	<a class="layui-btn layui-btn-warm  layui-btn-xs">已入库</a>
{{# }}}
</script>
 </div>
<script src="../../res/js/materialQualityTesting/materialQualityTesting.js" charset="utf-8"></script>

<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->

</body>
</html>